<?php
function ajaxJSON($state, $info = "", $data = null, $send = true) {
    if ($send) {
        echo json_encode(array("success" => $state, "info" => $info, "data" => $data));
        exit(0);
    } else {
        return json_encode(array("success" => $state, "info" => $info, "data" => $data));
    }
}